package com.changgou.item.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ItemMvcConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //如果请求路径是 /items 全部转到 classpath:/items/ 找对应的资源
        registry.addResourceHandler("/items/**")
                .addResourceLocations("classpath:/items/");
    }
}
